.class public Lcom/brixd/niceapp/model/EstimateModel;
.super Ljava/lang/Object;
.source "EstimateModel.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field private static final serialVersionUID:J = -0x6e5663da76c66d32L


# instance fields
.field private appId:I

.field private downNum:I

.field private downUsers:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/model/CommonUserModel;",
            ">;"
        }
    .end annotation
.end field

.field private source:Ljava/lang/String;

.field private timeUpdatedInMillis:J

.field private upNum:I

.field private upUsers:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/model/CommonUserModel;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 14
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static convertEstimateModleToCommonEntity(Lcom/brixd/niceapp/model/EstimateModel;)Lcom/brixd/niceapp/db/CommonEstimateEntity;
    .registers 5
    .param p0, "model"    # Lcom/brixd/niceapp/model/EstimateModel;

    .prologue
    .line 223
    new-instance v0, Lcom/brixd/niceapp/db/CommonEstimateEntity;

    invoke-direct {v0}, Lcom/brixd/niceapp/db/CommonEstimateEntity;-><init>()V

    .line 224
    .local v0, "entity":Lcom/brixd/niceapp/db/CommonEstimateEntity;
    invoke-virtual {p0}, Lcom/brixd/niceapp/model/EstimateModel;->getAppId()I

    move-result v1

    int-to-long v2, v1

    invoke-virtual {v0, v2, v3}, Lcom/brixd/niceapp/db/CommonEstimateEntity;->setArticleId(J)V

    .line 225
    invoke-virtual {p0}, Lcom/brixd/niceapp/model/EstimateModel;->getSource()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/CommonEstimateEntity;->setData(Ljava/lang/String;)V

    .line 226
    invoke-virtual {p0}, Lcom/brixd/niceapp/model/EstimateModel;->getTimeUpdatedInMillis()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/CommonEstimateEntity;->setTimeUpdated(Ljava/lang/Long;)V

    .line 228
    return-object v0
.end method

.method public static convertEstimateModleToEntity(Lcom/brixd/niceapp/model/EstimateModel;)Lcom/brixd/niceapp/db/EstimateEntity;
    .registers 5
    .param p0, "model"    # Lcom/brixd/niceapp/model/EstimateModel;

    .prologue
    .line 160
    new-instance v0, Lcom/brixd/niceapp/db/EstimateEntity;

    invoke-direct {v0}, Lcom/brixd/niceapp/db/EstimateEntity;-><init>()V

    .line 161
    .local v0, "entity":Lcom/brixd/niceapp/db/EstimateEntity;
    invoke-virtual {p0}, Lcom/brixd/niceapp/model/EstimateModel;->getAppId()I

    move-result v1

    int-to-long v2, v1

    invoke-virtual {v0, v2, v3}, Lcom/brixd/niceapp/db/EstimateEntity;->setAppID(J)V

    .line 162
    invoke-virtual {p0}, Lcom/brixd/niceapp/model/EstimateModel;->getSource()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/EstimateEntity;->setData(Ljava/lang/String;)V

    .line 163
    invoke-virtual {p0}, Lcom/brixd/niceapp/model/EstimateModel;->getTimeUpdatedInMillis()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/db/EstimateEntity;->setTimeUpdated(Ljava/lang/Long;)V

    .line 165
    return-object v0
.end method

.method public static parseEstimateModel(Lcom/brixd/niceapp/db/CommonEstimateEntity;)Lcom/brixd/niceapp/model/EstimateModel;
    .registers 7
    .param p0, "entity"    # Lcom/brixd/niceapp/db/CommonEstimateEntity;

    .prologue
    .line 175
    if-nez p0, :cond_4

    .line 177
    const/4 v2, 0x0

    .line 192
    :goto_3
    return-object v2

    .line 180
    :cond_4
    const/4 v2, 0x0

    .line 183
    .local v2, "model":Lcom/brixd/niceapp/model/EstimateModel;
    :try_start_5
    new-instance v1, Lorg/json/JSONObject;

    invoke-virtual {p0}, Lcom/brixd/niceapp/db/CommonEstimateEntity;->getData()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v3}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 184
    .local v1, "jsonObject":Lorg/json/JSONObject;
    invoke-static {v1}, Lcom/brixd/niceapp/model/EstimateModel;->parseEstimateModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/EstimateModel;

    move-result-object v2

    .line 185
    invoke-virtual {p0}, Lcom/brixd/niceapp/db/CommonEstimateEntity;->getTimeUpdated()Ljava/lang/Long;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Long;->longValue()J

    move-result-wide v4

    invoke-virtual {v2, v4, v5}, Lcom/brixd/niceapp/model/EstimateModel;->setTimeUpdatedInMillis(J)V
    :try_end_1d
    .catch Lorg/json/JSONException; {:try_start_5 .. :try_end_1d} :catch_1e

    goto :goto_3

    .line 187
    .end local v1    # "jsonObject":Lorg/json/JSONObject;
    :catch_1e
    move-exception v0

    .line 189
    .local v0, "e":Lorg/json/JSONException;
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_3
.end method

.method public static parseEstimateModel(Lcom/brixd/niceapp/db/EstimateEntity;)Lcom/brixd/niceapp/model/EstimateModel;
    .registers 7
    .param p0, "entity"    # Lcom/brixd/niceapp/db/EstimateEntity;

    .prologue
    .line 139
    if-nez p0, :cond_4

    .line 141
    const/4 v2, 0x0

    .line 156
    :goto_3
    return-object v2

    .line 144
    :cond_4
    const/4 v2, 0x0

    .line 147
    .local v2, "model":Lcom/brixd/niceapp/model/EstimateModel;
    :try_start_5
    new-instance v1, Lorg/json/JSONObject;

    invoke-virtual {p0}, Lcom/brixd/niceapp/db/EstimateEntity;->getData()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v3}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 148
    .local v1, "jsonObject":Lorg/json/JSONObject;
    invoke-static {v1}, Lcom/brixd/niceapp/model/EstimateModel;->parseEstimateModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/EstimateModel;

    move-result-object v2

    .line 149
    invoke-virtual {p0}, Lcom/brixd/niceapp/db/EstimateEntity;->getTimeUpdated()Ljava/lang/Long;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Long;->longValue()J

    move-result-wide v4

    invoke-virtual {v2, v4, v5}, Lcom/brixd/niceapp/model/EstimateModel;->setTimeUpdatedInMillis(J)V
    :try_end_1d
    .catch Lorg/json/JSONException; {:try_start_5 .. :try_end_1d} :catch_1e

    goto :goto_3

    .line 151
    .end local v1    # "jsonObject":Lorg/json/JSONObject;
    :catch_1e
    move-exception v0

    .line 153
    .local v0, "e":Lorg/json/JSONException;
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_3
.end method

.method public static parseEstimateModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/EstimateModel;
    .registers 5
    .param p0, "source"    # Lorg/json/JSONObject;

    .prologue
    .line 88
    new-instance v0, Lcom/brixd/niceapp/model/EstimateModel;

    invoke-direct {v0}, Lcom/brixd/niceapp/model/EstimateModel;-><init>()V

    .line 89
    .local v0, "model":Lcom/brixd/niceapp/model/EstimateModel;
    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setSource(Ljava/lang/String;)V

    .line 90
    const-string v1, "down"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_47

    .line 91
    const-string v1, "down"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setDownNum(I)V

    .line 96
    :cond_1d
    :goto_1d
    const-string v1, "up"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_59

    .line 97
    const-string v1, "up"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setUpNum(I)V

    .line 103
    :cond_2e
    :goto_2e
    const-string v1, "up_users"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v1

    invoke-static {v1}, Lcom/brixd/niceapp/model/CommonUserModel;->parseUserModels(Lorg/json/JSONArray;)Ljava/util/ArrayList;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setUpUsers(Ljava/util/ArrayList;)V

    .line 104
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v2

    invoke-virtual {v0, v2, v3}, Lcom/brixd/niceapp/model/EstimateModel;->setTimeUpdatedInMillis(J)V

    .line 106
    return-object v0

    .line 92
    :cond_47
    const-string v1, "down_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1d

    .line 93
    const-string v1, "down_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setDownNum(I)V

    goto :goto_1d

    .line 98
    :cond_59
    const-string v1, "up_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2e

    .line 99
    const-string v1, "up_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setUpNum(I)V

    goto :goto_2e
.end method

.method public static parseEstimateModel(Lorg/json/JSONObject;Lorg/json/JSONArray;)Lcom/brixd/niceapp/model/EstimateModel;
    .registers 6
    .param p0, "source"    # Lorg/json/JSONObject;
    .param p1, "upUsers"    # Lorg/json/JSONArray;

    .prologue
    .line 116
    new-instance v0, Lcom/brixd/niceapp/model/EstimateModel;

    invoke-direct {v0}, Lcom/brixd/niceapp/model/EstimateModel;-><init>()V

    .line 117
    .local v0, "model":Lcom/brixd/niceapp/model/EstimateModel;
    invoke-virtual {p0}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setSource(Ljava/lang/String;)V

    .line 118
    const-string v1, "down"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_41

    .line 119
    const-string v1, "down"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setDownNum(I)V

    .line 124
    :cond_1d
    :goto_1d
    const-string v1, "up"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_53

    .line 125
    const-string v1, "up"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setUpNum(I)V

    .line 131
    :cond_2e
    :goto_2e
    invoke-static {p1}, Lcom/brixd/niceapp/model/CommonUserModel;->parseUserModels(Lorg/json/JSONArray;)Ljava/util/ArrayList;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setUpUsers(Ljava/util/ArrayList;)V

    .line 132
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v1

    invoke-virtual {v1}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v2

    invoke-virtual {v0, v2, v3}, Lcom/brixd/niceapp/model/EstimateModel;->setTimeUpdatedInMillis(J)V

    .line 134
    return-object v0

    .line 120
    :cond_41
    const-string v1, "down_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_1d

    .line 121
    const-string v1, "down_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setDownNum(I)V

    goto :goto_1d

    .line 126
    :cond_53
    const-string v1, "up_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2e

    .line 127
    const-string v1, "up_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/EstimateModel;->setUpNum(I)V

    goto :goto_2e
.end method

.method public static parseEstimateModel2(Lcom/brixd/niceapp/db/CommonEstimateEntity;)Lcom/brixd/niceapp/model/EstimateModel;
    .registers 7
    .param p0, "entity"    # Lcom/brixd/niceapp/db/CommonEstimateEntity;

    .prologue
    .line 202
    if-nez p0, :cond_4

    .line 204
    const/4 v2, 0x0

    .line 219
    :goto_3
    return-object v2

    .line 207
    :cond_4
    const/4 v2, 0x0

    .line 210
    .local v2, "model":Lcom/brixd/niceapp/model/EstimateModel;
    :try_start_5
    new-instance v1, Lorg/json/JSONObject;

    invoke-virtual {p0}, Lcom/brixd/niceapp/db/CommonEstimateEntity;->getData()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v3}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 211
    .local v1, "jsonObject":Lorg/json/JSONObject;
    const-string v3, "up_users_detail"

    invoke-virtual {v1, v3}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    invoke-static {v1, v3}, Lcom/brixd/niceapp/model/EstimateModel;->parseEstimateModel(Lorg/json/JSONObject;Lorg/json/JSONArray;)Lcom/brixd/niceapp/model/EstimateModel;

    move-result-object v2

    .line 212
    invoke-virtual {p0}, Lcom/brixd/niceapp/db/CommonEstimateEntity;->getTimeUpdated()Ljava/lang/Long;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/Long;->longValue()J

    move-result-wide v4

    invoke-virtual {v2, v4, v5}, Lcom/brixd/niceapp/model/EstimateModel;->setTimeUpdatedInMillis(J)V
    :try_end_23
    .catch Lorg/json/JSONException; {:try_start_5 .. :try_end_23} :catch_24

    goto :goto_3

    .line 214
    .end local v1    # "jsonObject":Lorg/json/JSONObject;
    :catch_24
    move-exception v0

    .line 216
    .local v0, "e":Lorg/json/JSONException;
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_3
.end method


# virtual methods
.method public getAppId()I
    .registers 2

    .prologue
    .line 35
    iget v0, p0, Lcom/brixd/niceapp/model/EstimateModel;->appId:I

    return v0
.end method

.method public getDownNum()I
    .registers 2

    .prologue
    .line 51
    iget v0, p0, Lcom/brixd/niceapp/model/EstimateModel;->downNum:I

    return v0
.end method

.method public getSource()Ljava/lang/String;
    .registers 2

    .prologue
    .line 27
    iget-object v0, p0, Lcom/brixd/niceapp/model/EstimateModel;->source:Ljava/lang/String;

    return-object v0
.end method

.method public getTimeUpdatedInMillis()J
    .registers 3

    .prologue
    .line 75
    iget-wide v0, p0, Lcom/brixd/niceapp/model/EstimateModel;->timeUpdatedInMillis:J

    return-wide v0
.end method

.method public getUpNum()I
    .registers 2

    .prologue
    .line 43
    iget v0, p0, Lcom/brixd/niceapp/model/EstimateModel;->upNum:I

    return v0
.end method

.method public getUpUsers()Ljava/util/ArrayList;
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/model/CommonUserModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 59
    iget-object v0, p0, Lcom/brixd/niceapp/model/EstimateModel;->upUsers:Ljava/util/ArrayList;

    return-object v0
.end method

.method public setAppId(I)V
    .registers 2
    .param p1, "appId"    # I

    .prologue
    .line 39
    iput p1, p0, Lcom/brixd/niceapp/model/EstimateModel;->appId:I

    .line 40
    return-void
.end method

.method public setDownNum(I)V
    .registers 2
    .param p1, "downNum"    # I

    .prologue
    .line 55
    iput p1, p0, Lcom/brixd/niceapp/model/EstimateModel;->downNum:I

    .line 56
    return-void
.end method

.method public setSource(Ljava/lang/String;)V
    .registers 2
    .param p1, "source"    # Ljava/lang/String;

    .prologue
    .line 31
    iput-object p1, p0, Lcom/brixd/niceapp/model/EstimateModel;->source:Ljava/lang/String;

    .line 32
    return-void
.end method

.method public setTimeUpdatedInMillis(J)V
    .registers 4
    .param p1, "timeUpdatedInMillis"    # J

    .prologue
    .line 79
    iput-wide p1, p0, Lcom/brixd/niceapp/model/EstimateModel;->timeUpdatedInMillis:J

    .line 80
    return-void
.end method

.method public setUpNum(I)V
    .registers 2
    .param p1, "upNum"    # I

    .prologue
    .line 47
    iput p1, p0, Lcom/brixd/niceapp/model/EstimateModel;->upNum:I

    .line 48
    return-void
.end method

.method public setUpUsers(Ljava/util/ArrayList;)V
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/model/CommonUserModel;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 63
    .local p1, "upUsers":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/model/CommonUserModel;>;"
    iput-object p1, p0, Lcom/brixd/niceapp/model/EstimateModel;->upUsers:Ljava/util/ArrayList;

    .line 64
    return-void
.end method
